#This is a demonstration of making dot plots in R. # Note that R has a built-in function called # dotchart(). It does a specialized version of # a dot plot and it is beyond the charting used # in this course. Here we will use a function # called dot_plot() that you installed the first # day. # First we want to get the data into our session. # We will put the values into L1, not because it # is required but we are getting used to the idea # of having the values stored there. L1 <- c(13, 11, 8, 14, 14, 12, 13, 14, 13, 12, 13, 13, 8, 10, 15, 11, 11, 8, 13, 12, 12, 12, 13, 12 ) # as usual, verify the data L1 # Now we want to load our special function source( "../dot_plot.R") # and then just run that function with the given data dot_plot( L1 ) # then, just for comparison, let us make a bar # plot of the same data. barplot( table(L1)) abline(h=0,col="black",lty="solid") abline(h=seq(1,7,1), col="darkgrey", lty="dashed") par(new=TRUE) barplot( table(L1))